﻿@model ZealousTTS.Web.ViewModels.TaskViewModel
@using ZealousTTS.Web.Utility;

@{
	String pageTitle = "Edit Task";
    if (Model != null && Model.ID == 0)
    {             
        pageTitle = "Add New Task";
    }
    ViewBag.Title = Html.GetPageTitle(pageTitle);    
    Layout = "~/Views/Shared/_LayoutPrivate.cshtml";
}

<div class="jb-page-heading">
    <h1>@pageTitle</h1>
    <div>
        Add/Edit Task Information
    </div>
</div>
<script type="text/javascript" >
    $(document).ready(function () {
        $("input#Created, #Modified, #DueDate ").datepicker({ dateFormat: "dd-mm-yy" });
    });
</script>

@Html.JavaScript("jquery.validate.min.js", Url)
@Html.JavaScript("jquery.validate.unobtrusive.min.js", Url)

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)

	if (Model == null)
    {
        @: @Html.ErrorMessageBox("Sorry! Requested Task was not found for edit.")
    }
	else
	{
		<div class="jb-page-content">		    

			@Html.HiddenFor(model => model.ID)

			<div class="editor-label">
				@Html.LabelFor(model => model.ProjectID)
			</div>
			<div class="editor-field">
				@Html.EditorFor(model => model.ProjectID)
				@Html.ValidationMessageFor(model => model.ProjectID)
			</div>
			<div class="editor-label">
				@Html.LabelFor(model => model.OwnerID)
			</div>
			<div class="editor-field">
				@Html.EditorFor(model => model.OwnerID)
				@Html.ValidationMessageFor(model => model.OwnerID)
			</div>
			<div class="editor-label">
				@Html.LabelFor(model => model.AssignedTo)
			</div>
			<div class="editor-field">
				@Html.EditorFor(model => model.AssignedTo)
				@Html.ValidationMessageFor(model => model.AssignedTo)
			</div>
			<div class="editor-label">
				@Html.LabelFor(model => model.Description)
			</div>
			<div class="editor-field">
				@Html.TextAreaFor(model => model.Description)
				@Html.ValidationMessageFor(model => model.Description)
			</div>
			<div class="editor-label">
				@Html.LabelFor(model => model.PriorityID)
			</div>
			<div class="editor-field">
				@Html.EditorFor(model => model.PriorityID)
				@Html.ValidationMessageFor(model => model.PriorityID)
			</div>
<div class="Right_side">
			<div class="editor-label">
				@Html.LabelFor(model => model.StatusID)
			</div>
			<div class="editor-field">
				@Html.EditorFor(model => model.StatusID)
				@Html.ValidationMessageFor(model => model.StatusID)
			</div>
			<div class="editor-label">
				@Html.LabelFor(model => model.TaskTypeID)
			</div>
			<div class="editor-field">
				@Html.EditorFor(model => model.TaskTypeID)
				@Html.ValidationMessageFor(model => model.TaskTypeID)
			</div>
			<div class="editor-label">
				@Html.LabelFor(model => model.IsDeleted)
			</div>
			<div class="editor-field">
				@Html.EditorFor(model => model.IsDeleted)
				@Html.ValidationMessageFor(model => model.IsDeleted)
			</div>
			<div class="editor-label">
				@Html.LabelFor(model => model.DueDate)
			</div>
			<div class="editor-field">
				@Html.EditorFor(model => model.DueDate)
				@Html.ValidationMessageFor(model => model.DueDate)
			</div>
			<div class="editor-label">
				@Html.LabelFor(model => model.Modified)
			</div>
			<div class="editor-field">
				@Html.EditorFor(model => model.Modified)
				@Html.ValidationMessageFor(model => model.Modified)
			</div>
			<div class="editor-label">
				@Html.LabelFor(model => model.Created)
			</div>
			<div class="editor-field">
				@Html.EditorFor(model => model.Created)
				@Html.ValidationMessageFor(model => model.Created)
			</div>
   </div>
			<div>
				<input type="submit" value="Save" /> @Html.ActionLink("Back to List", "List","Task")
			</div>
		</div>
	}
}

